<?xml version="1.0" encoding="UTF-8"?>
<!--
  Created by IntelliJ IDEA.
  User: azim
  Date: 5/22/13
  Time: 3:49 PM
-->
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="templates/template.xhtml">

    <ui:define name="title">Category View Page</ui:define>

    <ui:define name="left">

        <p:menuitem value="Edit My Profile" ajax="false" action="#{userController.UserProfileForm}"/>
        <p:menuitem value="View My Profile" ajax="false" action="#{userController.showUserDetails(null)}"/>

    </ui:define>

    <ui:define name="cbody">

        <div>

            <h2>My Profile</h2>

            <br/>



            <div style="float: left; width: 100%">

                <p:accordionPanel cache="true">

                    <p:tab title="Basic Informations">

                        <div style="float: left; width: 84%">

                            <h:panelGrid columns="2" cellspacing="10">

                                <h:outputLabel value="Username : "/>
                                <h:outputLabel value="#{userController.user.username}"/>
                                <h:outputLabel value="User ID : "/>
                                <h:outputLabel value="#{userController.user.id}"/>
                                <h:outputLabel value="Uploaded Podcasts : "/>
                                <h:outputLabel value="#{podcastController.countPodcastByUserId(userController.user.id)}"/>
                            </h:panelGrid>

                        </div>

                        <div style="float: right; width: 15%">

                            <p:graphicImage width="150"
                                            height="150"
                                            value="#{mediaFileController.mediaFile}"
                                            alt="User Image.">

                                <f:param name="id" value="#{userController.user.userProfile.photo.id}"/>

                            </p:graphicImage>

                        </div>

                    </p:tab>

                </p:accordionPanel>

            </div>
            <div style="clear: both">
            <br/>
            <p:accordionPanel>

                <p:tab title="Personal Information">

                    <h:panelGrid columns="2" cellspacing="10">

                        <h:outputLabel value="First Name : "/>
                        <h:outputLabel value="#{userController.user.userProfile.firstName}"/>
                        <h:outputLabel value="Last Name : "/>
                        <h:outputLabel value="#{userController.user.userProfile.lastName}"/>
                        <h:outputLabel value="Email : "/>
                        <h:outputLabel value="#{userController.user.email}"/>
                        <h:outputLabel value="Contact No : "/>
                        <h:outputLabel value="#{userController.user.userProfile.contactNo}"/>
                        <h:outputLabel value="Address : "/>
                        <h:outputLabel value="#{userController.user.userProfile.address}"/>
                        <h:outputLabel value="Date Joined : "/>
                        <h:outputLabel value="#{userController.user.dateCreated}"/>

                    </h:panelGrid>

                </p:tab>

            </p:accordionPanel>
            </div>

            <p:messages globalOnly="true"/>

        </div>

    </ui:define>

</ui:composition>

</html>